Skip to content

feat(id): parameterise web adapter binding from [interfaces.web] (#2325) - #3894

Merged
dezren39 merged 3 commits into
mainfrom
queue/5772-2325-web-adapter
Nov 2, 2026
Merged

dezren39 merged 3 commits into
mainfrom
queue/5772-2325-web-adapter

Conversation

@dezren39

@dezren39 dezren39 commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Phase 4 of the #2028 ID core v1 synthesis — the #2026 design §4.1 work: the web adapter binding stops being hardcoded to one world and reads route/socket from the app's app.toml [interfaces.web] section (mode=adapter).

What

  • New pkgs/id/src/web/app_interface.rs — WebInterface / WebMode and web_interface_from_app_toml: parses [interfaces.web] (mode = adapter|direct, route, optional socket) out of an app.toml document. Absent section → None (a pure CLI app is valid, id: investigate: app packaging — apps as folders (code + resources), TUI/web interface parity, web-native specialization #2026 §2); unknown mode is an error. WebInterface::world_app() names the historical binding (adapter, /world, /ws/world). Folder discovery / reading app.toml from disk stays with id: PoC: package tic-tac-toe as the first apps/ folder — app.toml + host discovery #2324 — this is the binding layer it feeds.
  • world_ws::world_routes_at(socket) — the world session bridge with its live channel bound per app; world_routes() delegates at /ws/world, unchanged. All other routes (invite, metrics, directory, explore) are the shared API surface, unchanged.
  • routes::create_router_for_app(state, &interface) — the main router with the world page bound at the app's route and the bridge merged at the app's socket (merge still happens before the body-limit layer and state, exactly as today). create_router delegates with world_app(), so the existing world app is byte-identical: same routes, handlers, layer order, state.

Direct-for-web mode (§4.2) is parsed but not bound here, per the packet's exclusions; the pack step (§5) is untouched.

Tests

  • app_interface parse tests: custom adapter binding, in-section defaults, absent section, direct mode, unknown mode rejected.
  • world_ws::two_apps_bind_distinct_sockets: two apps served side by side — each answers a websocket handshake on its own socket (/ws/world, /ws/arena) and refuses the other's.

Crate-level verification runs in CI on this PR: a fresh worktree's cold cargo build could not finish inside the worker shift budget on the (heavily loaded) laptop, so the queue task is parked on the CI result + Codex review rather than claiming local verification it did not get.

Queue: task 5772 (repo-health-code-pilot), lane A.

Closes #2325


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Phase 4 of the #2028 ID core v1 synthesis (#2026 design section 4.1):
the web adapter binding stops being hardcoded to one world.

- New web/app_interface.rs: WebInterface + WebMode parsed from an
  app.toml [interfaces.web] section (mode adapter|direct, route,
  optional socket), with WebInterface::world_app() naming the
  historical binding (adapter, /world, /ws/world). Folder discovery
  stays #2324; this is the binding layer it will feed.
- world_ws::world_routes_at(socket): the session bridge with its
  live channel bound per app; world_routes() delegates at
  /ws/world, unchanged.
- routes::create_router_for_app(state, interface): world page at
  the app route, bridge merged at the app socket; create_router
  delegates with world_app() and is byte-identical (same routes,
  handlers, layer order, state).

Tests: app_interface parse tests (custom binding, in-section
defaults, absent section, direct mode, unknown mode) and
world_ws two_apps_bind_distinct_sockets - two apps handshaking on
their own sockets and refusing each other's. Crate verification
runs in CI on the PR (fresh-worktree cold build exceeds the shift
budget on a loaded laptop).
@dezren39
dezren39 requested a review from a team as a code owner November 1, 2026 17:52
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 50 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: aff89141-5b45-478e-9588-de8af6976b4e
Commits

Reviewing files that changed from the base of the PR and between f7c942b and c37c753.

Files selected for processing: 7
  • pkgs/id/src/web/app_interface.rs
  • pkgs/id/src/web/home.rs
  • pkgs/id/src/web/mod.rs
  • pkgs/id/src/web/routes.rs
  • pkgs/id/src/web/templates.rs
  • pkgs/id/src/web/world_ws.rs
  • pkgs/id/web/src/world.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T02:24:28.756108Z c37c753 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2eb0074bce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkgs/id/src/web/routes.rs Resolved
Comment thread pkgs/id/src/web/routes.rs Resolved
Comment thread pkgs/id/src/web/routes.rs Resolved
…ocket to the frontend, configured route on the home page, shared HTTP routes without a socket (#2325)

Dispositions the three Codex findings on 2eb0074 (PR #3894):
- P1: the world page renderer now carries the app socket as
  data-world-socket on the root element and world.ts connects
  join/upload/compile to it (historical /ws/world stays the
  default when no attribute is rendered).
- P2: render_home takes the app page route; explorer links and
  the global-chat iframe use it instead of hardcoded /world.
- P2: world_routes_at is split - world_http_routes() serves the
  shared HTTP surface (invite, metrics, directory, explore) and
  create_router_for_app merges it even when the app declares no
  socket; only the websocket bridge is socket-bound.
AppState carries the binding (web_route/web_socket, world-app
defaults); create_router_for_app stamps it from the interface.
Tests: http_routes_serve_without_a_socket (metrics 401 not 404,
explore 200), home custom-route assertions, world page socket
attribute assertion. cargo check -p id --lib passes, cargo fmt
clean; full suites run in CI (the id-core lib-test target fails
to compile on this base for an unrelated missing vt100 dev
dependency - pre-existing, untouched by this change).
@dezren39

dezren39 commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

New head 39a4d6505: all three findings from the Codex review of 2eb0074bc are fixed and replied on their threads (4436728135 → 4438287276; 4436728140 → 4438287401; 4436728144 → 4438287533). @chatgpt-codex-connector please re-review the new head.

Record correction: this PR is queue task 5772's own PR (see its body) — the intervening "Drew-owned hard stop" parks rested on author == dezren39, the account all fleet PRs use; no hard-stop labels are present.

Local verification: cargo check -p id --lib passes, cargo fmt clean for the touched files. Full test suites run in CI on this head (the id-core lib-test target fails to compile on this base for a pre-existing missing vt100 dev-dependency in the extracted sub-crate — unrelated to this change; CI will show whether it affects this PR's checks).

Queue task 5772 parked on CI + this re-review; will resume, verify, and merge when both are green/clean.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 39a4d65052

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkgs/id/src/web/routes.rs Resolved
Re-export create_router_for_app and the app_interface manifest types (WebInterface, WebMode, WebInterfaceError, web_interface_from_app_toml) from id::web, so a host that has read its app.toml can select the [interfaces.web] binding through the public API instead of create_router always forcing the world app binding. Fixes the Codex P2 on PR #3894. New upload_router_tests::public_entry_point_honours_a_configured_binding builds an /arena router purely via crate::web paths and asserts /arena serves while /world 404s.
@dezren39

dezren39 commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

🤖 Agent note · parked

  • Agent: queue worker (repo-worker-code), lane C shift
  • Session / ID: task 5772
  • Found via: queue claim
  • Task: task 5772 picked PR feat(id): parameterise web adapter binding from [interfaces.web] (#2325) #3894 back up. Ownership correction: this PR is the task's own canonical PR (branch queue/5772-2325-web-adapter; the dezren39 author is the shared fleet account) — the earlier Drew-owned note was the known misread, and no hard-stop label exists. The one undispositioned Codex finding (4438300975, configurable router entry point not public) is fixed in c37c753: id::web re-exports create_router_for_app plus WebInterface/WebMode/WebInterfaceError/web_interface_from_app_toml, with a public-path regression test. All 4 Codex threads are now replied and resolved.
  • Expectation: task 5772 parked 20m for CI + Codex re-review of c37c753; resume = merge when green/clean.

@dezren39 dezren39 added work/assigned Queue worker lifecycle state queue/parked Queue task is parked (waiting on CI, time, or an event) status/parked Deliberately paused with a recorded resume condition queue/claimed Queue worker lifecycle state status/in-progress Queue worker lifecycle state and removed status/parked Deliberately paused with a recorded resume condition queue/parked Queue task is parked (waiting on CI, time, or an event) status/in-progress Queue worker lifecycle state queue/claimed Queue worker lifecycle state labels Nov 2, 2026
@dezren39
dezren39 merged commit 24ac655 into main Nov 2, 2026
4 of 33 checks passed
@dezren39
dezren39 deleted the queue/5772-2325-web-adapter branch November 2, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

queue/parked Queue task is parked (waiting on CI, time, or an event) status/parked Deliberately paused with a recorded resume condition work/assigned Queue worker lifecycle state

Projects

None yet

Development

Successfully merging this pull request may close these issues.

id: implement the [interfaces.web] adapter binding — parameterise /world + /ws/world from app.toml

1 participant